package com.tqyan.model.mapping;

import com.tqyan.model.controller.response.ChatContentResp;
import com.tqyan.model.controller.response.ChatResp;
import com.tqyan.model.dto.ChatContentDTO;
import com.tqyan.model.dto.ChatDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @description 会话转换
 * <p> <功能详细描述> </p>
 *
 * @author 陈晨
 * @date 2023/4/14 00:14
 */
@Mapper(componentModel="spring")
public interface ChatAssembler {

    @Mapping(target = "chatId", source = "id")
    ChatResp convertChat(ChatDTO chat);

    @Mapping(target = "chatId", source = "id")
    List<ChatResp> convertChat(List<ChatDTO> chatList);

    @Mapping(target = "chatContentId", source = "id")
    ChatContentResp convertChatContent(ChatContentDTO chat);

    @Mapping(target = "chatContentId", source = "id")
    List<ChatContentResp> convertChatContent(List<ChatContentDTO> chatList);

}


